package cn.script.game.dup;

import cn.script.call_api.AfterApi;
import cn.script.call_api.BeforeApi;
import cn.script.domain.Point;
import cn.script.game.GameOpt;
import cn.script.game.prof.Pi;
import cn.script.util.Delay;

/**
 * 弑神副本
 */
public class SisDup extends AbstractDup {

    private boolean isBoss = false;

    public SisDup(Pi pi, GameOpt gameOpt,Boolean isBoss) {
        super("弑神副本", pi, gameOpt);
        this.isBoss = isBoss;
    }

    @Override
    protected BeforeApi beFore() {
        return () -> {
            this.go.toCity("魔幻海村");
            this.go.wio().keypress("f11",500);
            this.go.wio().leftClick(Point.point(236,329));
            Delay.delay(500);
            this.go.wio().leftClick(Point.point(159,312));
            this.go.wio().keypress("f10",500);
            Delay.delay(1000);
            return 1;
        };
    }

    @Override
    public DupInfo dupInfo() {
        DupInfo dupInfo = new DupInfo(this.go, this.optName);

//        // 2: 269,345 80,147 众神劫傀儡王(首领)
//        dupInfo.dupOpt("双锤金刚(首领)")
//                .a_skills(this.pi.skills())
//                .m_winPoint(341,442)
//                .m_gamePoint(293,355)
//                .m_rPoint(8,8)
//                .a_endNum(3)
//                .a_timeOut(30000);
        dupInfo.dupOpt("无头骑士(首领)")
                .a_skills(this.pi.skills())
                .m_winPoint(608,303)
                .m_gamePoint(287,82)
                .m_rPoint(8,8)
                .a_endNum(3)
                .a_timeOut(30000);
        // 3: 421,453 72,63 众神劫大将军(首领)
        dupInfo.dupOpt("战神白起(首领)")
                .a_skills(this.pi.skills())
                .m_winPoint(521,379)
                .m_gamePoint(320,202)
                .m_rPoint(8,8)
                .a_endNum(3)
                .a_timeOut(30000);



        // 1: 364,390  127,145  众神劫牛魔王(首领)
        dupInfo.dupOpt("大猪蹄子(首领)")
                .a_skills(this.pi.skills())
                .m_winPoint(220, 346)
                .m_gamePoint(136,319)
                .m_rPoint(8,8)
                .a_endNum(3)
                .a_timeOut(30000);
        if (isBoss){
            return dupInfo;
        }

//        dupInfo.dupOpt("送葬者(首领)")
//                .a_skills(this.pi.skills())
//                .m_winPoint(517,256)
//                .m_gamePoint(194,80)
//                .m_rPoint(8,8)
//                .a_endNum(3)
//                .a_timeOut(30000);
        return dupInfo;
    }

    @Override
    protected AfterApi after() {
        return ()->{
//            this.go.toBack();
//            Delay.delay(5000);
            return 1;
        };
    }
}
